package org.apache.zookeeper.recipes.lock.twitter;

import java.util.concurrent.TimeUnit;

public interface DistributedLock {
	void lock() throws LockingException;

	boolean tryLock(long timeout, TimeUnit unit);

	void unlock() throws LockingException;

	public static class LockingException extends RuntimeException {
		public LockingException(String msg, Exception e) {
			super(msg, e);
		}

		public LockingException(String msg) {
			super(msg);
		}
	}
}
